Circuits and methods for measuring a current

ABSTRACT

A circuit is provided, including a first resistor, a second resistor which may have an adjustable resistance, and a control unit. The control unit may be configured to adjust the second resistor to have a first resistance at which a voltage due to a first current flowing through the first resistor is equal to a voltage due to a second current flowing through the second resistor. The control unit may be further configured to adjust the second resistor to have a second resistance at which a voltage due to another first current different from the first current and flowing through the first resistor is equal to the voltage due to the second current flowing through the second resistor. The control unit may be further configured to adjust the second resistor to have a third resistance based on at least a difference of the first resistance and the second resistance.

TECHNICAL FIELD

Various embodiments generally relate to circuits and methods formeasuring a current, as well as methods for setting a ratio of aresistance of a first resistor to a resistance of a second resistor.

BACKGROUND

Currents may need to be measured, for example when controlling a loadcurrent or to provide over-current protection. The current may bemeasured by measuring another proportional current. The proportionalityfactor of the currents may be given by a resistance ratio. The accuracyof the measurement may depend on the accuracy of the resistance ratio.However, the resistance ratio may change over time and temperature andmay be subject to manufacturing variations. The overall uncertainty maybe as much as 28%.

The resistance ratio may be corrected after end of line testing.However, this usually involves additional costs and not all productiontechnologies offer correction factors. Further, the use of correctionfactors will not solve the problems of drift over time and temperature.

SUMMARY

A circuit is provided, including a first resistor, a second resistorwith an adjustable resistance and a control unit. The control unit maybe configured to adjust the second resistor to have a first resistanceat which a voltage due to a first current flowing through the firstresistor is equal to a voltage due to a second current flowing throughthe second resistor. It may further be configured to adjust the secondresistor to have a second resistance at which a voltage due to anotherfirst current different from the first current and flowing through thefirst resistor is equal to the voltage due to the second current flowingthrough the second resistor. It may still further be configured toadjust the second resistor to have a third resistance based on at leasta difference of the first resistance and the second resistance.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings, like reference characters generally refer to the sameparts throughout the different views. The drawings are not necessarilyto scale, emphasis instead generally being placed upon illustrating theprinciples of the invention. In the drawings, the left-most digit(s) ofa reference number can identify the drawing in which the referencenumber first appears. The same numbers can be used throughout thedrawings to reference like features and components. In the followingdescription, various embodiments of the invention are described withreference to the following drawings, in which:

FIG. 1 shows an embodiment of a circuit for setting a resistance ratio;

FIG. 2 shows an embodiment of a method for setting a resistance ratio;

FIG. 3 shows an embodiment of a circuit for setting a resistance ratio;

FIG. 4 shows an embodiment of a current supply;

FIG. 5 shows an embodiment of another current supply;

FIG. 6 shows an embodiment of a current measuring circuit; and

FIG. 7 shows an embodiment of a method for current measuring.

DESCRIPTION

The following detailed description refers to the accompanying drawingsthat show, by way of illustration, specific details and embodiments inwhich the invention may be practiced.

The word “exemplary” is used herein to mean “serving as an example,instance, or illustration”. Any embodiment or design described herein as“exemplary” is not necessarily to be construed as preferred oradvantageous over other embodiments or designs.

FIG. 1 shows an embodiment 100 of a circuit including a first resistor102, a second resistor 104 with an adjustable resistance and a controlunit 106. The control unit 106 may be configured to adjust theresistance of the second resistor 104. A first current I_(L1) flowingthrough the first resistor 102 may produce or cause a voltage V1 a andanother first current I_(L2) flowing through the first resistor 102 mayproduce a voltage V1 b. The voltage V1 a and the voltage V1 b may bevoltages of a node 108 to which the first resistor 102 is electricallycoupled or connected to. The another first current I_(L2) may bedifferent from the first current I_(L1). A second current I₂ flowingthrough the second resistor 104 may produce or cause voltages V2 a, V2b, depending on the resistance of the second resistor 104. The voltagesV2 a, V2 b may be voltages of a node 110 to which the second resistor104 is electrically coupled or connected to. The voltage V1 a, thevoltage V1 b and the voltage V2 may be referenced to a same referencepotential, for example a ground potential.

The control unit 106 may be configured to adjust the resistance of thesecond resistor 104 to have a first resistance X at which the voltage V1a due to the first current I_(L1) flowing through the first resistor 102is equal to the voltage V2 a due to the second current I₂ flowingthrough the second resistor 104. The control unit 106 may be furtherconfigured to adjust the resistance of the second resistor 104 to have asecond resistance Y at which the voltage V1 b due the another firstcurrent I_(L2) flowing through the first resistor 102 is equal to thevoltage V2 b due to the second current I₂ flowing through the secondresistor 104. The control unit 106 may be still further configured toadjust the resistance of the second resistor 104 to have a thirdresistance Z based on a difference of the first resistance X and thesecond resistance Y.

In various embodiments, a ratio K₁=I_(L1)/I₂ of the first current I_(L1)to the second current I₂ may be between 1,000 and 50,000. For example,it may be 20,000. However, the ratio K₁ is not limited to this range, itcan be smaller than 1,000 or larger than 50,000. The ratio K₁ may begiven by the ratio of the current to be measured, for example a loadcurrent Iload, to the current that is actually measured or sensed, forexample a sense current Is.

In various embodiments, a ratio K₂=I_(L2)/I_(L1) of the another firstcurrent I_(L2) to the first current I_(L1) may be between 1.1 to 20. Forexample, it may be 3. However, the ratio K₂ is not limited to thisrange. The another first current I_(L2) may also be smaller than thefirst current I_(L1). The ratio K₂ may be given by a ratio of a maximumresistance of the second resistor 104 to a minimum resistance of thesecond resistor 104.

In various embodiments, the first resistor 102 may be any resistor. Itmay for example be a current sense resistor, that is, a resistorconfigured to carry a large current with a low voltage drop.

In various embodiments, the second resistor 104 may be a referenceresistor. It may have a discretely adjustable resistance, for exampleprovided by switchable resistors. The resistance may for example beadjusted by connecting resistors in parallel or in serial to each other,for example by means of switches. Some or all of the resistors may havethe same resistance. They may, for example, be poly-silicon resistors.

In various embodiments, at least one of the first resistor 102 and thesecond resistor 104 may have a continuously adjustable resistance, forexample provided by a transistor. The resistance between two controlledterminals of a transistor, for example between the source and the drainof the transistor, may be adjusted by applying a signal to a controlterminal of the transistor, for example to a gate terminal of thetransistor. The transistor may act as an active resistance. It may, forexample, be a MOSFET or a IGBT.

In various embodiments, the first resistor 102 and the second resistor104 may consist of different materials. However, they can also consistof the same material, for example aluminum, which may reduce temperaturedependencies. In various embodiments, the first resistor 102 and thesecond resistor 104 may be produced in the same production process,which may reduce production variations. For example, they may be formedin the same metallization layer. However, they can also be produced indifferent production processes. For example, the first resistor 102 maybe a bond wire and the second resistor 104 may be a planar resistor madefrom the same material, for example aluminum. In various embodiments,the first resistor 102 and the second resistor 104 may consist ofdifferent materials and may be produced by different productionprocesses. For example, the first resistor 102 may be a bond wire andthe second resistor 104 may be a polysilicon resistor.

FIG. 2 shows an embodiment 200 of a method for setting a ratio of aresistance of a first resistor to a resistance of a second resistor. Theembodiment 200 may be applied to the embodiment 100 and vice versa.

The method may include a step 202 of applying a first current I_(L1) tothe first resistor 102 to obtain a first voltage V1 a, a step 204 ofapplying a second current I₂ to the second resistor 104 to obtain asecond voltage V2 a, and a step 206 of obtaining a first value x of acontrol signal configured to set the resistance of the second resistor104 by adjusting a value of the control signal until a differencebetween the first voltage V1 a and the second voltage V2 a vanishes orchanges its sign. The steps 202 to 206 may be part of a first measuringphase. The control signal may be the control signal 328 shown in FIG. 3.

The method may further include a step 208 of applying another firstcurrent I_(L2) to the first resistor 102 to obtain another first voltageV1 b, wherein the another first current I_(L2) differs from the firstcurrent I_(L1), a step 210 of applying the second current I₂ to thesecond resistor 104 to obtain a another second voltage V2 b, and a step212 of obtaining a second value y of the control signal by adjusting thevalue of the control signal until the difference between the anotherfirst voltage V1 b and the another second voltage V2 b vanishes orchanges its sign. The steps 208 to 212 may be part of a second measuringphase.

The method may still further include a step 214 of determining a thirdvalue z of the control signal based on the difference of the first valuex and the second value y, and a step 216 of setting the resistance ofthe second resistor 104 by means of the third value z of the controlsignal.

In various embodiments, determining the third value z may be furtherbased on at least one of a ratio K₁ of the first current I_(L1) to thesecond current I₂, a ratio K₂ of the another first current I_(L2) to thefirst current I_(L1), and a target ratio dK_(ILIS) of the resistance ofthe second resistor 104 to a resistance of the first resistor 102.

FIG. 3 shows an embodiment 300 of a circuit. The embodiment 300 mayillustrate the embodiment 100 of the circuit shown FIG. 1 and theembodiment 200 of the method shown in FIG. 2 in more detail. Thefeatures described in conjunction with embodiment 100 and embodiment 200may also apply to embodiment 300 and vice versa.

The circuit may be used to set a ratio between a resistance R_(SH,IC) ofthe second resistor 104 to a resistance R_(BDW) of the first resistor102. It may be desired to adjust the ratio R_(SH,IC)/R_(BDW) to a targetratio dK_(ILIS). While in principle the resistance of one of the firstresistor 102 and the second resistor 104 may be varied, the firstresistor 102 may be in the load current path and it may be difficult toaccess it or to vary it. It may therefore be easier to vary the secondresistor 104.

As is described in conjunction with FIG. 6, the current Iload through aload coupled to terminal OUT may be determined from the current flowingthrough the second resistor 104 if the ratio between the resistanceR_(BDW) of the first resistor 102 and the resistance R_(SH,IC) of asecond resistor 104 is known. This ratio may be set to the target ratiodK_(ILIS) by adjusting the resistance R_(SH,IC) of the second resistor104. The load current Iload may then be measured accurately since theresistance ratio is known accurately.

The first resistor 102 may be may be coupled between a supply voltage Vsand a load and may be used in so-called high-side current sensing.However, the first resistor 102 may also be coupled between the load anda reference potential, such as a ground potential GND, and may be usedwith the necessary modification of the circuit in so-called low-sidecurrent sensing. A switching element M0 may be coupled to the firstresistor 102. The switching element M0 may be a transistor and may beactivated by a signal applied to its control terminal GH to allow acurrent to flow from the supply voltage Vs through the load. A currentflowing through the first resistor 102 may cause a voltage drop acrossit which may be used to determine the current.

The use of the circuit for setting the ratio between the resistanceR_(BDW) of the first resistor 102 and the resistance R_(SH,IC) of thesecond resistor 104 is not limited to current measurement; it may alsobe used for current balancing in parallel paths, for example in currentmirrors, where a fixed resistance ratio, for example of one, is needed.Another use of the circuit may be in measurement technology, where anexact ratio of resistances is needed, for example in calibration or inbridge circuits.

In various embodiments, the first resistor 102 may be a contactresistor, that is, a resistor formed by a contacting means. Thecontacting means may be used for electrically connecting the switchingelement M0 to the supply voltage Vs or a reference potential. Thecontact resistor may for example be a bond wire, for example consistingof aluminum. It may for example be part of or all of a metallization,such as a lateral metallization, of an electrode, for example of asource electrode, of the switching element M0.

In various embodiments, the circuit may have two connections 330, 332 tothe first resistor 102. The two connections 330, 332 may for exampleconnect a metallization of the switching element M0, such as a sourceelectrode lateral metallization. The metallization may be coupled orconnected to the supply voltage Vs via the first resistor 102, which maybe a bond wire or a different part of the same metallization. The twoconnections 330, 332 may form two resistors 308 and 310. The resistors308 and 310 may have resistances R_(SRC1) and R_(SRC2), respectively,depending on the location of the connections 330, 332 on themetallization. The location of the connections 330, 332 on themetallization may be chosen freely as long as all of the current flowingthrough the connection 332 with the switching element M0 turned off alsoflows through the first resistor 102.

The connection 330 may be coupled to a terminal SHS, for example via abondwire 304 with a resistance R_(BND2). The connection 332 may becoupled to a terminal SHF, for example via a bondwire 306 with aresistance R_(BND3). The two connections 330, 332 may allow a currentI_(L1), I_(L2) to flow through the first resistor 102 without having acurrent flowing in bond wire 304. A current flowing through the bondwire 304 may lead to incorrect measurements of V1, especially ifR_(BDN2) is not negligible with respect to R_(BDW).

Bond wires 302, 304, 306 connecting terminal VS, SHS, SHF, respectivelyand resistors 308, 310 are shown to indicate possible ways ofconnections in the circuit. However, each of these elements may bereplaced by other connecting methods and may be optional. For example,the circuit will also work without terminals VS, SHS, SHF and if thebond wires 302, 304, 306 and resistors 308, 310 are replaced by shortcircuits.

One end of the second resistor 104 may be coupled to the supply voltageVs, for example via terminal VS and bond wire 302. Another end of thesecond resistor 104 may be coupled to a current supply 312. Theresistance of the second resistor 104 may be controlled or set by acontrol signal 328.

A current source 314 with a current I_(DC,SUPPLY) may be used to modelcurrent consumption of the circuit, for example of a control unit 106.One end of the current source 314 may be coupled to the terminal VS andto the second resistor 104. Another end of the current supply 314 may becoupled to a reference potential, such as a ground potential GND.

In various embodiments, the current supply 312 may be coupled to thefirst resistor 102 and the second resistor 104. The current supply 312may be configured to provide the first current I_(L1) and the anotherfirst current I_(L2) to the first resistor 102 and to provide the secondcurrent I₂ to the second resistor 104. Embodiments of current supplies312 are shown and described in more detail in conjunction with FIGS. 4and 5.

The control unit 106 may be configured to set the current supply 312 toprovide the first current I_(L1) and the second current I₂ whenadjusting the second resistor 104 to have the first resistance X. It maybe configured to set the current supply 312 to provide the another firstcurrent I_(L1) and the second current I₂ when adjusting the secondresistor 104 to have the second resistance Y. The control unit 106 maybe configured to turn off the first current I_(L1), the another firstcurrent I_(L2) and the second current I₂ after adjusting the secondresistor 104 to have the third resistance Z.

In various embodiments, the control unit 106 may include a timing unit316. The timing unit 316 may provide timing and control signals for thecurrent supply 312, a resistor setting unit 324, a comparator 326 and acalculation unit 322. It may have an input connected to a clock signal320. It may further have an input 318 for applying a signal to startsetting the resistance ratio.

In various embodiments, the control unit 106 may include a resistorsetting unit 324. The resistor setting unit 324 may set the resistanceR_(SH,IC) of the second resistor 104 by supplying a control signal 328to the second resistor 104. The control signal 328 may for exampleoperate switches which are used to add or subtract resistance, forexample by connecting or disconnecting resistors in series or inparallel. The control signal 328 may for example be a signal which isapplied to a control terminal such as a gate of a continuously variableresistance such as a transistor.

In various embodiments, the control unit 106 may include a comparator326. The comparator 326 may be turned on and off by the timing unit 316.It may be turned on when the resistance ratio is set and it may beturned off after the resistance ratio has been set. It may be configuredto compare the voltage V1 due to the first current I_(L1) or due to theanother first current I_(L2) with the voltage V2 due to the secondcurrent I₂. If the voltage V1 and the voltage V2 are not equal, theoutput of the comparator 326 will cause the resistor setting unit 324 tochange the resistance R_(SH,IC) of the second resistor 104. If thevoltage V1 and the voltage V2 are equal or if their difference haschanged its sign compared to the sign before the output of thecomparator 326 was changed, the output of the comparator 326 may causethe value of the control signal 328 to be stored in the calculation unit322.

In various embodiments, the control unit 106 may include a calculationunit 322 configured to determine the third resistance Z. The thirdresistance Z may be determined or calculated based on at least one ofthe difference of the first resistance X and the second resistance Y,the ratio K₁ of the first current I_(L1) to the second current I₂, theratio K₂ of the another first current I_(L2) to the first currentI_(L1), and the target ratio dK_(ILIS) of the resistance R_(SH,IC) ofthe second resistor 104 to a resistance R_(BDW) of the first resistor102. The third resistance Z may be supplied to the resistor setting unit324 to set the resistance R_(SH,IC) of the second resistor 104 toachieve the target ratio.

The calculation unit 322 may comprise a memory. The memory may beconfigured to store values x, y, z needed for setting the secondresistor 104 to have the first resistance X, the second resistance Y andthe third resistance Z. The values x, y, z may for example be integervalues which may indicate how many unit resistors with a resistance ofR_(T) are to be connected in series. For example, X=x·R_(T), Y=y·R_(T)and Z=z·R_(T). The values x, y, z may for example be values which may beapplied to a resistance circuit configured to have the first resistanceX, the second resistance Y and the third resistance Z, respectively. Forexample, the values x, y, z may be voltage values and the resistancecircuit may be a transistor. The voltage values x, y, z may be appliedto a gate of the transistor.

Setting the target ratio dK_(ILIS) may include a first measurement phasefollowed by a second measurement phase and a calculation phase. The loadcurrent Iload may set to be zero or to have a constant value during thefirst measurement phase and the second measurement phase.

In the first measurement phase, the control unit 106 may cause a firstcurrent I_(L1) to flow through the first resistor 102 which may have aresistance R_(BDW). The first current I_(L1) may cause a voltage V1=V1a. The voltage V1 a may be used as a reference voltage at a first input327 of the comparator 326. Then, the control unit 106 may cause a secondcurrent I₂ to flow through the second resistor 104 which may have aresistance R_(SH,IC). The second current I₂ may be smaller than thefirst current I_(L1) and may cause a voltage V2 a at a second input 325of the comparator 326. The resistance R_(SH,IC) of the second resistor104 may be varied by varying the value of the control signal 328supplied by the resistor setting unit 324, for example by starting froma extreme value such as its maximum value or its minimum value. Theresistance R_(SH,IC) may be adjusted until the comparator 326 detects achange in sign or a vanishing of the difference of the voltages V1 a−V2a. At a resistance R_(SH,IC)=x·R_(T) the difference of the voltages V1a−V2 a changes its sign or disappears. The value x of control value 328may be stored by the calculation unit 322.

Starting from V1 a=V2 a and substituting resistances and currents yieldsEq. 1:R _(BDW) ·I _(LS) =R _(BDNS) ·I ₂ +R _(BDN1) ·I _(DC,SUPPLY) +x·R _(T)·I ₂ +U _(OFFSET,Komparator)  (1)

The supply current I_(DC,SUPPLY) may need to be taken into account ifthe voltage difference caused by the first resistor 102 is very small.

In the second measurement phase, the above procedure is repeated withthe another first current I_(L2) instead of the first current I_(L1).The another first current I_(L2) may be different from the first currentI_(L1). However, the second current I₂ may be kept the same.

The resistance R_(SH,IC) of the second resistor 104 may be varied againuntil the comparator 326 detects a change in sign or a vanishing of thedifference of the voltages V1=V1 b and V2=V2 b. At a resistanceR_(SH,IC)=y·R_(T) the difference of the voltages V1 b−V2 b changes itssign or disappears. The value y of control value 328 may be stored bythe calculation unit 322.

Starting from V1 b=V2 b and substituting resistances and currents yieldsEq. 2:R _(BDW) ·I _(L2) =R _(BDNS) ·I ₂ +R _(BDN1) ·I _(DC,SUPPLY) +y·R _(T)·I ₂ +U _(OFFSET,Komparator)  (2)

In the computation phase, a value z is determined or calculated from thevalues x, y, the current ratios K₁, K₂ and the target ratio dK_(ILIS).The value z may be used by the resistor setting unit 324 to set theresistance R_(SH,IC) of the second resistor 104 to R_(SH,IC)=z·R_(T).

Assuming that the supply current I_(DC,SUPPLY) and the comparator offsetU_(OFFSET,Komparator) remain constant, subtracting Eq. 1 from Eq. 2 andreordering yields:R _(BDW)·(I _(L2) −I _(L1))=(y−x)·R _(T) ·I ₂  (3)

The resistance R_(BDW) of the first resistor 102 may be substituted by:

$\begin{matrix}{R_{BDW} = \frac{R_{{SH},{IC}}}{{dK}_{ILIS}}} & (4)\end{matrix}$

where dK_(ILIS) may represent the target ratio. Further substitutingR_(SH,IC) by R_(SH,IC)=z·R_(T) yields:

$\begin{matrix}{{\frac{z \cdot R_{T}}{{dK}_{ILIS}} \cdot \left( {I_{L\; 2} - I_{L\; 1}} \right)} = {\left( {y - x} \right) \cdot R_{T} \cdot I_{2}}} & (5)\end{matrix}$

Solving for z gives the number of unit resistors with a resistance R_(T)that is required to obtain the target ratio:

$\begin{matrix}{z = {\left( {y - x} \right) \cdot {dK}_{ILIS} \cdot \frac{I_{2}}{\left( {I_{L\; 2} - I_{L\; 1}} \right)}}} & (6)\end{matrix}$

It may be difficult to produce absolute values of currents I_(L1),I_(L2) and I₂ accurately. However, ratios of currents may be reproducedaccurately. Using

$\begin{matrix}{I_{2} = \frac{I_{L\; 1}}{K_{1}}} & (7)\end{matrix}$

andI _(L2) =K ₂ ·I _(L1)  (8)

in Eq. 6 yields:

$\begin{matrix}{z = {\left( {y - x} \right) \cdot \frac{{dK}_{ILIS}}{K_{1}} \cdot \frac{1}{\left( {K_{2} - 1} \right)}}} & (9)\end{matrix}$

The accuracy of the ratios K₁, K₂ may determine the accuracy with whichthe ratio of the resistance R_(SH,IC) of the second resistor 104 to theresistance R_(BWD) of the first resistor 102 may be set. Embodiments ofcurrent supplies 312 which may apply such accurate ratios are describedin conjunction with FIGS. 4 and 5.

FIG. 4 shows an embodiment 400 of a current supply 312. The embodiment400 illustrates the current supply shown FIG. 3 in more detail. Thefeatures described in conjunction with embodiment 300 may also apply toembodiment 400 and vice versa.

In various embodiments, the current supply 312 may include a firsttransistor 413, a second transistor 415 and a third transistor 417. Acontrolled terminal 430 of the first transistor 413 may be coupled tothe first resistor 102, for example via terminal SHF. A controlledterminal 432 of the second transistor 415 may be coupled to the secondresistor 104. A controlled terminal 434 of the third transistor 417 maybe coupled via to the second resistor 104, for example via a thirdswitch S3. A gate 414 of the first transistor 413, a gate 416 of thesecond transistor 415 and a gate 418 of the third transistor 417 may becoupled together and may be controlled by a feedback loop 420. Thefeedback loop 420 may include a switchable voltage divider 422 and anoperational amplifier 402. The operational amplifier 402 may include apositive input 404 which may be coupled to a reference voltage Vref anda negative input 405 which may be coupled to the feedback loop 420. Theswitchable voltage divider 422 may be coupled to another controlledterminal 424 of the first transistor 413, another controlled terminal426 of the second transistor 415 and another controlled terminal 428 ofthe third transistor 417. It may include a resistor 406, a resistor 408,a first switch S1 and a second switch S2. The resistor 406 may have aresistance of R₂=R₁·(K₂−1) and the resistor 408 may have a resistance ofR₁. The resistor 406 and the resistor 408 may be connected in series toeach other. One end 409 of the series connection may be coupled toanother reference potential, for example to a ground potential GND. Theother end 411 of the series connection may be coupled to the anothercontrolled terminal 424 of the first transistor 413, the anothercontrolled terminal 426 of the second transistor 415 and the anothercontrolled terminal 428 of the third transistor 417. The first switch S1may couple the other end 411 of the series connection to the negativeinput 405 of the operational amplifier 402. A node 407 at which theresistor 406 and the resistor 408 are coupled together may be coupledvia the second switch S2 to the negative input 405 of the operationalamplifier 402.

Operating the third switch S3 may change the second current I₂. When thethird switch S3 is closed, the second transistor 415 and the thirdtransistor 417 are connected in parallel to each other and the currentsflowing through them are added. When the third switch S3 is open, thesecond current I₂ is made up of only the current flowing through thesecond transistor 415. If the current I_(F) through the switchablevoltage divider 422 is held constant, this may result in differentcurrents I_(L1), I_(L2) flowing through the first resistor 102, as isdesired. However, the current I₂ flowing through the second resistor 104may also change.

To keep the second current I₂ constant, it may be necessary to changethe current I_(F) through the switchable voltage divider 422 whenoperating the third switch S3. The current I_(F) through the switchablevoltage divider 422 may be changed by operating the first switch S1 andthe second switch S2. The first switch S1 and the second switch S2 maychange the resistance in the feedback loop 420 so that a differentcurrent I_(F) is needed to regulate the other end 411 of the switchablevoltage divider 422 to have a voltage equal to Vref. The resistances ofthe resistors 406, 408 of the switchable voltage divider 422 may bechosen so that the change in current I₂ through the second resistor 104caused by operating the switch S3 is compensated and current I₂ is keptconstant. Operating the first switch S1 and the second switch S2 at thesame time as operating the third switch S3 will allow different currentsI_(L1) and I_(L2), to flow through the first resistor 102 while keepingcurrent I₂ through the second resistor 104 the same.

While the switchable voltage divider 422 is shown with two switches S1and S2, different arrangements of switchable voltage dividers arepossible. For example, the switchable voltage divider may have a singleswitch in parallel to the resistor 406 or in parallel to the resistor408. Or, instead of connecting resistors 406 and 408 in series, theycould also be connected in parallel to each other.

During the first measurement phase, the first switch S1 and the thirdswitch S3 may be closed, that is conducting, and the second switch S2may be open, that is non-conducting. The operational amplifier 402 mayforce the other end 411 of the series connection to have a voltage equalto Vref, which causes a current I_(F1) to flow through the seriesconnection of the resistor 406 and the resistor 408. Current I_(F1) maybe determined by the resistance of the series connection asI_(F1)=Vref/(R₁(K₂−1)+R₁)=Vref/(R₁·K₂). Current I_(F1) may be the sum ofthe first current I_(L1) through the first transistor 413 and the firstresistor 102 and of the second current I₂, where the second current I₂flows through the second resistor 104 and is made up of the currentsthrough the second transistor 415 and the third transistor 417. Thevoltage Vref applied to the positive input 404 of the operationalamplifier 402 may remain unchanged during the first measurement phaseand the second measurement phase.

During the second measurement phase, the first switch S1 and the thirdswitch S3 may be open and the second switch S2 may be closed. Theoperational amplifier 402 may force node 407 of the series connection tohave a voltage equal to Vref, which causes a current I_(F2) to flowthrough the series connection. Current I_(F2) may be determined by theresistance of the resistor 408 as I_(F2)=Vref/R₁. Current I_(F2) may bethe sum of the another first current I_(F2) through the first transistor413 and the first resistor 102 and of the second current I₂, where thesecond current I₂ flows through the second resistor 104 and the secondtransistor 415.

In various embodiments, the ratio K₁=I_(L1)/I₂ of the first currentI_(F1) to the second current I₂ may be set by a ratio of transistorgeometries. The transistor geometry may be given by a ratio M=W/L of awidth W of a channel of a transistor to a length L of a channel of atransistor. The transistor geometry may determine the conductivity of atransistor. The ratio of transistor geometries may be a first transistorgeometry M1=W1/L1 of the first transistor 413 to a second transistorgeometry M23=W23/L23. The second transistor geometry M23 may be aneffective transistor geometry of the second transistor 415 and the thirdtransistor 417. Since the second transistor 415 and the third transistor417 are connected in parallel, their conductivities may be added. Theeffective transistor geometry M23 may be M23=M2+M3 with M2=W2/L2 beingthe transistor geometry of the second transistor 415 and M3=W3/L3 beingthe transistor geometry of the third transistor 417. The ratio K₁ may beset by K₁=M1/(M2+M3). If, on the other hand K₁ and K₂ are given, thetransistors may be dimensioned as: M1/M2=K₁·K₂ and M3/M2=K₂−1.

In various embodiments, the ratio K₂=I_(F2)/L₁ of the another firstcurrent I_(F2) to the first current I_(L1) may be set by a ratio of thecurrent I_(F2)=Vref/R₁ flowing through the switchable voltage divider422 in the second measurement phase to the current I_(F1)=Vref/(R₁·K₂)flowing through the switchable voltage divider 422 in the firstmeasurement phase. The ratio of currents may be set by a ratio of theresistance of the switchable voltage divider 422 in the firstmeasurement phase to the resistance of the switchable voltage divider422 in the second measurement phase. The resistance during the firstmeasurement phase is the sum of the resistances of resistor 406 andresistor 408, that is R₁+R₂=R₁+R₁·(K₂−1)=R₁·K₂ and the resistance duringthe second measurement phase is R₁. The actual value of R₁ cancels whenforming the ratio and the ratio of R2 to R1 is R₁·(K₂−1)/R₁=K₂−1, whichis independent of R₁.

In embodiment 400, both the first resistor 102 and the second resistor104 may be supplied with current during the first measurement phase andthe second measurement phase.

FIG. 5 shows another embodiment 500 of the current supply 312. Theembodiment 500 illustrates the current supply shown FIG. 3 in moredetail. The features described in conjunction with embodiment 300 mayalso apply to embodiment 500 and vice versa.

In various embodiments, the current supply 312 may include a firsttransistor 513, a second transistor 515 and a third transistor 517. Thefirst transistor 513 and the second transistor 515 may be coupled inparallel to each other and may be coupled to the first resistor 102, forexample via terminal SHF. The third transistor 517 may be coupled to thesecond resistor 104.

The current supply 312 may further include a first feedback loop 504, asecond feedback loop 506 and a third feedback loop 508. The firstfeedback loop 504 may include an operational amplifier 402, the firsttransistor 513 and a series connection of a resistors 406 and a resistor408. The series connection of the resistors 406 and 408 may have one endconnected to a reference potential, such as the ground potential GND andanother end 411 coupled to a controlled terminal of the first transistor513 and a controlled terminal of the second transistor 515. The seriesconnection may have a node 407 at which the resistor 406 and 408 arecoupled to each other.

The second feedback loop 506 may include the operational amplifier 402,the third transistor 517 and a resistor 502. One end of the resistor 502may be connected to a reference potential, such as the ground potentialGND and another end 510 of the resistor 502 may be coupled to acontrolled terminal of the third transistor 517.

The third feedback loop 508 may include the operational amplifier 402,the first transistor 513 and the second transistor 515 connected inparallel to each other, and the series connection of the resistors 406and 408.

An output 520 of the operational amplifier 402 may be coupled to therespective control inputs of the first transistor 513, the secondtransistor 515 and the third transistor 517. A positive input 404 of theoperational amplifier 402 may be coupled to a reference potential Vref.In various embodiments, the first feedback loop 504, the second feedbackloop 506 and the third feedback loop 508 may share the same operationalamplifier 402. This may result in more stable ratios of the currentsI_(L1), I₂, and I_(L2) as these ratios will only depend on the ratios ofthe resistances of the resistors 406, 408, and 510 if the offset of theoperational amplifier 402 remains constant.

A switch S1 may be coupled between the control input of the firsttransistor 513 and the output 520 of the operational amplifier 402. Aswitch S2 may be coupled between the control input of the secondtransistor 515 and the output 520 of the operational amplifier 402. Aswitch S3 may be coupled between the control input of the thirdtransistor 517 and the output 520 of the operational amplifier 402. Aswitch S4 may be coupled between the node 407 and the negative input 405of the operational amplifier 402. A switch S5 may be coupled between theother end 411 of the series connection and the negative input 405 of theoperational amplifier 402. A switch S6 may be coupled between the otherend 510 of the resistor 502 and the negative input 405 of theoperational amplifier 402. The switches S1 to S6 may be controlled bythe control unit 106 to be closed or open, that is to be conducting ornon-conducting.

In various embodiments, the current supply 312 may be configured tocontrol the first transistor 513 to provide the first current I_(L1) viathe first feedback loop 504, to control the third transistor 517 toprovide the second current I₂ via the second feedback loop 506, and tocontrol the first transistor 513 and the second transistor 515 toprovide the another first current I_(L2) via the third feedback loop508.

In various embodiments, the current supply 312 may be further configuredto provide the first current I_(L1), the second current I₂, the anotherfirst current I_(L2) and the second current I₂ in that order. Thecurrent supply 312 may be further configured to provide only one of thefirst current I_(L1), the second current I₂, the another first currentI_(L2) at a time. For example, the first current I_(L1) may be turnedoff before the second current I₂ is provided. The second current I₂ maybe turned off before the another first current I_(L2) is provided. Theanother first current I_(L2) may be turned off before the second currentI₂ is again provided.

The transistors 513, 515 and 517 and the switches S1 to S6 may becontrolled, for example by the control unit 106, in four phases Φ1, Φ2,Φ3 and Φ4 to sequentially provide the first current I_(L1), the secondcurrent I₂, the another first current I_(L2) and the second current I₂.The phases Φ1 and Φ2 may be part of the first measuring phase and thephases Φ3 and Φ4 may be part of the second measuring phase.

During the first phase Φ1, switch S1 and switch S5 may be closed andswitches S2, S3, S4 and S6 may be open. The operational amplifier 402may control the first transistor 513, for example via its gate, to forcethe other end 411 of the series connection to the reference potentialVref, which may cause a current I_(L1) to flow through the seriesconnection of the resistor 406 and the resistor 408. Current I_(L1) maybe determined by the resistance of the series connectionR₁+R₂=R₁+R₁·(K₂−1)=R₁·K₂ as I_(L1)=Vref/(R₁·K₂).

In various embodiments, the voltage V1 a due to the first current I_(L1)may be stored or may be used as an offset for the comparator 326.

During the second phase Φ2, switch S3 and switch S6 may be closed andswitches S1, S2, S4 and S5 may be open. The operational amplifier 402may control the third transistor 517, for example via its gate, to forcethe other end 510 of the resistor 502 to the reference potential Vref,which may cause a current I₂ to flow through the resistor 502. CurrentI₂ may be determined by the resistance R₃=R₁·K₁·K₂ of the resistor 502as I₂=Vref/(R₁·K₁·K₂).

The resistance R_(SH,IC) of the second resistor 104 may be adjustedusing the control unit 106 as described in conjunction with FIG. 3 toachieve V1 a=V2 a. However, the voltage V1 a may not be available in thecircuit at the same time as the voltage V2 a is available. In variousembodiments, a stored value of the voltage V1 a may be applied at aninput 327 of the comparator 326, for example by applying a stored valueto a digital-to-analogue converter.

In various embodiments, the value of V1 a may be used as an offset forthe comparator 326. In this way, smaller signals may be used, allowinglower values of I_(L1)/I_(L2).

At the end of phase Φ2, the corresponding control value 328, for examplethe value x or a voltage level, may be provided by the resistor settingunit 324 and may be stored in the calculation unit 322.

During the third phase Φ3, switch S1, switch S2 and switch S4 may beclosed and switches S3, S5 and S6 may be open. The operational amplifier402 may control the first transistor 513 and the second transistor 515,for example via their gates, to force node 407 between the resistors 406and 408 to the reference potential Vref, which may cause a currentI_(L2) to flow through the series connection of the resistor 406 and theresistor 408. Current I_(L2) may be determined by the resistance R₁ ofresistor 408 as I_(L2)=Vref/R₁.

In various embodiments, the voltage V1 b due to the another firstcurrent I_(L2) may be stored or may be used as an offset for thecomparator 326.

The fourth phase Φ4 may be the same as the second phase Φ2, with thesame setting of the switches, the same feedback loop 506 and the samecurrent I₂=Vref/(R₁·K₁·K₂). The resistance R_(SH,IC) of the secondresistor 104 may again be adjusted using the control unit 106 asdescribed in conjunction with FIG. 3 to achieve V1 b=V2 b. Again,voltage V1 b may not be present at the same time as voltage V2 b so thata stored value V1 b may be applied to the comparator 326 or the voltageV1 b may be used as an offset for the comparator 326. At the end ofphase Φ4, the corresponding control value 328, for example the value yor a voltage level, may be provided by the resistor setting unit 324 andmay be stored in the calculation unit 322.

In various embodiments, the ratio K₁=I_(L1)/I₂ of the first currentI_(L1) to the second current I₂ may be set by K₁=R₃/(R₁+R₂). In variousembodiments, the ratio K₂=I_(L2)/I_(L1) of the another first currentI_(L1) to the first current I_(L2) may be set by K₂=1+R₂/R₁.

The reference voltage V_(REF) applied to the positive input 404 of theoperational amplifier 402 may be the same in all four phases Φ1, Φ1, Φ1and Φ4. If further the offset voltage and the amplification of theoperational amplifier 402 are kept the same, the voltage at theresistors 406, 408, 502 in the feedback loops 504, 506, 508 will also bethe same, namely Vref.

In contrast to the embodiment 400 shown in FIG. 4, embodiment 500 hasthree independent control loops to separately set I_(L1), I_(L2) and I₂.It may therefore be easier to set the currents I_(L1), I_(L2) and I₂.Further, only one of the first resistor 102 and the second resistor 104is supplied with current during the first measurement phase and thesecond measurement phase, so that the current consumption may bereduced.

In principle, there is no need to have different transistor geometriesof the transistors 513, 515, 517 as the they do not share a commoncurrent through the switchable voltage divider. Further, the secondtransistor 515 may be omitted, as the current through the firsttransistor 513 and the first resistor 102 may be adjusted by switchingthe voltage divider using switches S4 and S5. In various embodiments,the current supply 312 may therefore include a first transistor 513coupled to the first resistor 102 and a third transistor 517 coupled tothe second resistor 104. The current supply 312 may be configured tocontrol the first transistor 513 to provide the first current I_(L1) viaa feedback loop, to control the first transistor 513 and to control thefeedback loop, for example by switching the voltage divider made up ofresistors 406 and 408, to provide the another first current I_(L2), andto control the third transistor 517 to provide the second current I₂ viaa second feedback loop 506.

However, in various embodiments, the load conditions at the output 520of the operational amplifier 402 may be held constant, for example toreduce second order effects of the operational amplifier 402. In variousembodiments, this may be achieved by providing the same effectivetransistor geometries of the transistors 513, 515 and 517. The firsttransistor 513 may have a transistor geometry of M1, the secondtransistor 515 may have a transistor geometry of M2=M1·(K₂−1) and thethird transistor 517 may have a transistor geometry of M3=M1/K₁. Thedifferent widths of the transistors may change the capacitive load onthe output 520 of the operational amplifier 402 which may be compensatedfor by adding parallel capacitors for the smaller gates or by providingan operational amplifier 402 with a stable output for all transistorwidths. However, if such an operational amplifier 402 is used, thedifferent rates of control speed may need to be considered for.

The ratios K₁=R₃/(R₁+R₂)=1/(R₁/R₃+R₂/R₃) and K₂=1+R₂/R₁ may depend onlyon the ratio of the resistances of the resistors 406, 408, 502. A ratioof resistances may be produced with a variation of 1% to 2%, for exampleby matching. Even more accurate ratios are possible if the resistors406, 408, 502 are formed in integrated circuits, for example by usinglaser cutting at wafer level.

FIG. 6 shows an embodiment 600 of a circuit which may be used forcurrent measurement. The circuit may be based on the circuits andmethods described in conjunction with FIGS. 1 to 5 and the featuresdescribed in conjunction with embodiments 100 to 500 may also apply toembodiment 600 and vice versa. For simplification, the control unit 106and the current supply 312 are shown as black boxes.

A load may be connected to terminal OUT. The transistor M0 may becontrolled by a gate signal applied to its gate terminal GH to control acurrent Iload flowing through the load.

In various embodiments, the circuit may include an operational amplifier604. The operational amplifier 604 may be configured to compare avoltage V1 due a current Iload in the first resistor 102 with a voltageV2 due to the current Is in the second resistor 104. A positive input603 of the operational amplifier 604 may be coupled, for example viaresistor 304, to the first resistor 102, for example, to an end of thefirst resistor 102 not connected to the supply voltage Vs. A negativeinput 605 of the operational amplifier 604 may be coupled or connectedto the first resistor 102, for example, to an end of the second resistor104 not connected to the supply voltage Vs.

In various embodiments, the circuit may further include a transistor 602coupled to the second resistor 104. The transistor 602 may be controlledby the operational amplifier 604 in a feedback loop 606. One controlledterminal of the transistor 602 may be coupled or connected to the firstresistor 102, for example, to an end of the second resistor 104 notconnected to the supply voltage Vs. Another controlled terminal of thetransistor 602 may be coupled or connected to a terminal IS. A currentIs may flow between the controlled terminal and the another controlledterminal of the transistor 602. A current sink may be connected toterminal IS and the current Is may be determined or measured. An output607 of the operational amplifier 604 may be coupled or connected to acontrol input, for example a gate, of the transistor 602.

The current Iload may be determined as follows:

The target ratio dK_(ILIS) may be set as described above. The controlunit 106 may output a control signal 328 with a value z to adjust theresistance R_(SH,IC) of the second resistor 104. During setting theresistance ratio, the transistor M0 may be turned off or the currentflowing through it may be held constant, so as not to influence thevoltage V1 a, V1 b. After the ratio is set, the current supply 312 maybe turned off, that is I_(L1)=I_(L2)=I₂=0 by the control unit 106.

The operational amplifier 604 may force voltages V1 and V2 to be equal,that is V1=V2, by adjusting the current Is flowing through transistor602. If it may be assumed that there is no voltage drop across resistor304, for example if there is no current flow into the control unit 106and into the positive input 603 of the operational amplifier 604, thismay result in:R _(BDW) ·Iload=R _(SH,IC) ·Is  (10)

In contrast to setting the resistance ratio, where the voltages V1 andV2 are matched by varying the resistance R_(SH,IC) and keeping thecurrents I_(L1), I_(L2) constant, the resistance R_(SH,IC) is heldconstant here and the current Is is varied in order to match thevoltages V1 and V2. The load current may than the calculated byIload=Is·R _(SH,IC) /R _(BDW) =dK _(ILIS) ·Is  (11)

FIG. 7 shows an embodiment 700 of a method for measuring a current. Themethod may include a step 702 of setting the ratio of the resistanceR_(SH,IC) of the second resistor 104 to the resistance R_(BDW) of thefirst resistor 102, for example as described in conjunction withembodiments 100 to 500. The method may include a step 704 of providing acurrent flow Iload through the first resistor 102. The method mayinclude a step 706 of determining the current flow Is through the secondresistor 104. The method may include a step 708 of determining thecurrent flow Iload through the first resistor 102 based on the ratio ofthe resistance R_(SH,IC) of the second resistor 104 to the resistanceR_(BDW) of the first resistor 102 and the current flow Is through thesecond resistor 104.

In various embodiments, the method may further include coupling thefirst resistor 102 and the second resistor 104 to a common supplyvoltage Vs. For example, the first resistor 102 may be directlyconnected to the supply voltage and the second resistor 104 may becoupled via the resistor 302 to the supply voltage, as is shown in FIG.6.

In various embodiments, determining the current flow Is through thesecond resistor 104 may include regulating the current flow through thesecond resistor 104 until a voltage V1 due to the current flow Iloadthrough the first resistor 102 is equal to a voltage V2 due to thecurrent flow Is in the second resistor 104.

In various embodiments, the ratio is set at at least one of thefollowing times: before providing a current flow Iload through the firstresistor 102; at predetermined times, for example periodically or at setintervals; when the target ratio dK_(ILIS) is changed; and after achange in conditions that may change the resistance of the firstresistor 102 or the second resistor 104, such as for example a change intemperature. The ratio may also be set after a user input, for exampleif the user decides that the ratio may have changed.

In various embodiments, the current flow Iload through the firstresistor 102 is turned off or kept at a constant value when setting theratio of the resistance R_(BDW) of the first resistor 102 to theresistance R_(SH,IC) of a second resistor 104.

In various embodiments, the first current I_(L1), the another firstcurrent I_(L2) and the second current I₂ are turned off before providingthe current flow Iload through the first resistor 102.

The embodiments of the circuits and the methods described above may havethe following error sources:

The second resistor 104 may include several smaller resistors with aresistance R_(T). The resistance R_(T) in relation to a maximumresistance R_(SH,IC,MAX) of the second resistor 102 may cause aquantization error, which may be about 0.5 to 1.5%.

The uncertainties in the ratios K₁ and K₂ may also present an errorsource. The resistors 406, 408, 502 determining the ratios K₁ and K₂ mayconsist of the same material. An accuracy of 1.5% may be possible bymatching, which may be reduced to less than 1% with frontend trimming.

The offset voltage U_(OFFSET,Komparator) of the comparator 326 may beeliminated provided that it remains constant.

Variations in the output voltage of the operational amplifier 402 willnot be a source of errors for K₁ and K₂ as the geometries of thetransistors may be chosen so that the operational amplifier 402 has thesame load.

Noise may also be a considerable source of error since the expectedvoltage levels at the first resistor 102 may only be about a few hundredmicro volts (μV). This source of error may be reduced by a low pass inthe signal path SHS with a capacitance on the side of the comparator326. A capacitance of about 10 pF may result in an effective noisevoltage of about 20 μV. The low pass may also improve electromagneticinterference properties.

As an example, the first resistance 102 may be a bond wire with adiameter of 600 μm and a length of about 3.5 mm. With productiontolerances of ±15% and at a temperature −40° C., its lowest resistancemay be R_(BDW)=231Ω. Let I_(L1)=1 A and K₂=3 to give I_(L3)=3 A. Thesignal magnitude of the differential measurement R_(BDW)·I_(L1) andR_(BDW)·I_(L2) may be about 462 μV and the deviation due to noise may be2.20 μV=40 μV, which is about ±8.7%. Adding errors caused byinaccuracies of the factors K₁ and K₂ and the limited resolutionR_(T)/R_(SH,IC,MAX) of the second resistor 104 may give a variation of±12% for the ratio of the resistances dK_(ILIS). The accuracy may beeven higher if a bond wire with a larger resistance is used. IncreasingK₂ may further increase the accuracy since the signal levels willincrease, thus reducing the effect of noise.

The circuits and the methods described above may also be used when thefirst resistor 102 is a lateral metallization. The target ratiodK_(ILIS) may be set in the off-state of the transistor M0. However,during the on-state, the current distribution in the lateralmetallization may change the effective lateral resistance. To compensatethis effect, the target ratio dK_(ILIS) may be set again after thetransistor M0 is conducting a constant current Iload and the effectivelateral resistance does not change anymore.

The circuits and the methods described above may have the followingadvantages:

The target ratio dK_(ILIS) may be changed easily which allows a simplechanging of the measurement range.

Further, the first resistor 102 may be made from a completely differentmaterial than the second resistor 104 without losing accuracy if ameasurement is performed directly after setting the resistance ratio.

The temperature dependencies of the first resistor 102 and the secondresistor 104 should be about the same if the temperature changes betweensetting the resistance ratio and performing the measurement. However,different environmental dependencies and drift over time may becompensated by setting the resistance ratio shortly before performingthe measurement.

The production processes of the first resistor 102 and the secondresistor 104 may be different and the production variations may beuncorrelated.

Variations in the length of a bond wire due to the setup of the dieattach and the wire bonding which influence the resistance R_(BDW) ofthe first resistor 102 may be compensated.

While the invention has been particularly shown and described withreference to specific embodiments, it should be understood by thoseskilled in the art that various changes in form and detail may be madetherein without departing from the spirit and scope of the invention asdefined by the appended claims. The scope of the invention is thusindicated by the appended claims and all changes which come within themeaning and range of equivalency of the claims are therefore intended tobe embraced.

What is claimed is:
 1. A circuit, comprising: a first resistor; a secondresistor with an adjustable resistance; a control unit configured: toadjust the second resistor to have a first resistance at which a voltagedue to a first current flowing through the first resistor is equal to avoltage due to a second current flowing through the second resistor; toadjust the second resistor to have a second resistance at which avoltage due to another first current different from the first currentand flowing through the first resistor is equal to the voltage due tothe second current flowing through the second resistor; and to adjustthe second resistor to have a third resistance based on at least adifference of the first resistance and the second resistance.
 2. Thecircuit according to claim 1, further comprising: a current supplycoupled to the first resistor and the second resistor and configured toprovide the first current and the another first current to the firstresistor and to provide the second current to the second resistor. 3.The circuit according to claim 1, wherein a ratio of the first currentto the second current is set by a ratio of a first transistor geometryto a second transistor geometry.
 4. The circuit according to claim 1,wherein a ratio of the first current to the second current is set by aratio of a resistance of a resistor to a resistance of another resistor.5. The circuit according to claim 1, wherein the ratio of the firstcurrent to the second current is equal to 1; or between 1,000 and50,000.
 6. The circuit according to claim 1, wherein a ratio of theanother first current to the first current is set by a ratio of aresistance of a resistor to a resistance of another resistor.
 7. Thecurrent sensing circuit according to claim 1, wherein the ratio of theanother first current to the first current is between 1.1 to
 20. 8. Thecircuit according to claim 2, wherein the current supply comprises afirst transistor coupled to the first resistor; a second transistorcoupled to the second resistor; a third transistor coupled via a switchto the second resistor, wherein a gate of the first transistor, a gateof the second transistor, and a gate of the third transistor are coupledtogether and controlled by a feedback loop comprising a switchablevoltage divider coupled to a controlled terminal of the firsttransistor, a controlled terminal of the second transistor, and acontrolled terminal of the third transistor.
 9. The circuit according toclaim 2, wherein the current supply comprises: a first transistorcoupled to the first resistor; a third transistor coupled to the secondresistor, wherein the current supply is configured: to control the firsttransistor to provide the first current via a feedback loop; to controlthe first transistor and to control the feedback loop to provide theanother first current; and to control the third transistor to providethe second current via a second feedback loop; or wherein the currentsupply comprises: a first transistor and a second transistor coupled inparallel to each other and coupled to the first resistor; a thirdtransistor coupled to the second resistor, wherein the current supply isconfigured: to control the first transistor to provide the first currentvia a first feedback loop; to control the third transistor to providethe second current via a second feedback loop; to control the firsttransistor and the second transistor to provide the another firstcurrent via a third feedback loop.
 10. The circuit according to claim 9,wherein the current supply is further configured to provide the firstcurrent, the second current, the another first current and the secondcurrent in that order.
 11. The circuit according to claim 9, wherein thefirst feedback loop, the second feedback loop and the third feedbackloop share a same operational amplifier.
 12. The circuit according toclaim 2, wherein the control unit is configured: to set the currentsupply to provide the first current and the second current whenadjusting the second resistor to have the first resistance; to set thecurrent supply to provide the another first current and the secondcurrent when adjusting the second resistor to have the secondresistance; and to turn off the first current, the another first currentand the second current after having adjusted the second resistor to havethe third resistance.
 13. The circuit according to claim 1, wherein thecontrol unit comprises a comparator configured to compare the voltagedue to the first current or due to the another first current with thevoltage due to the second current.
 14. The circuit according to claim13, wherein the voltages due to the first current and the another firstcurrent are stored or are used as offsets for the comparator.
 15. Thecircuit according to claim 1, wherein the control unit comprises acalculation unit configured to determine the third resistance based on:the difference of the first resistance and the second resistance; theratio of the another first current and the first current; the ratio ofthe first current and the second current; and a target ratio of aresistance of the second resistor to a resistance of the first resistor.16. The circuit according to claim 1, further comprising: a switchingelement coupled to the first resistor.
 17. The circuit according toclaim 16, further comprising: a operational amplifier configured tocompare a voltage due to a current in the first resistor with a voltagedue to the current in the second resistor.
 18. The circuit according toclaim 17, further comprising: a transistor coupled to the secondresistor and controlled by the operational amplifier in a feedback loop.19. The circuit according to claim 1, wherein the first resistor and thesecond resistor consist of different materials.
 20. The circuitaccording to claim 1, wherein the first resistor is a contact resistorof a switching element, for example a bond wire for connecting theswitching element or a metallization, for example a lateralmetallization, of an electrode, for example of a source electrode, ofthe switching element.
 21. The circuit according to claim 1, wherein thesecond resistor has a discretely adjustable resistance, for exampleprovided by switchable poly-silicon resistors.
 22. The circuit accordingto claim 1, wherein at least one of: the first resistor; and the secondresistor has a continuously adjustable resistance, for example providedby a transistor.
 23. A method for setting a ratio of a resistance of afirst resistor to a resistance of a second resistor, comprising:applying a first current to the first resistor to obtain a firstvoltage; applying a second current to the second resistor to obtain asecond voltage; obtaining a first value of a control signal configuredto set the resistance of the second resistor by adjusting a value of thecontrol signal until a difference between the first voltage and thesecond voltage vanishes or changes its sign; applying another firstcurrent to the first resistor to obtain another first voltage, whereinthe another first current differs from the first current; applying thesecond current to the second resistor to obtain a another secondvoltage; obtaining a second value of the control signal by adjusting thevalue of the control signal until the difference between the anotherfirst voltage and the another second voltage vanishes or changes itssign; determining a third value of the control signal based on thedifference of the first value and the second value; and setting theresistance of the second resistor by means of the third value of thecontrol signal.
 24. The method according to claim 23, whereindetermining the third value is further based on at least one of: a ratioof the first current and the second current; a ratio of the anotherfirst current and the first current; and a target ratio of theresistance of the second resistor to a resistance of the first resistor.25. A method for measuring a current, comprising: setting the ratio ofthe resistance of the first resistor to the resistance of a secondresistor according to claim 23; providing a current flow through thefirst resistor; determining the current flow through the secondresistor; and determining the current flow through the first resistorbased on the ratio of the resistance of the first resistor to theresistance of a second resistor and the current flow through the secondresistor.
 26. The method of claim 25, further comprising: coupling thefirst resistor and the second resistor to a common supply voltage. 27.The method of claim 25, wherein determining the current flow through thesecond resistor comprises regulating the current flow through the secondresistor until a voltage due to the current flow through the firstresistor is equal to a voltage due to the current flow in the secondresistor.
 28. The method of claim 25, wherein the ratio is set at atleast one of the following times: before providing a current flowthrough the first resistor; at predetermined times; when the targetratio is changed; after a user input; and after a change in temperature.29. The method of claim 25, wherein the current flow through the firstresistor is turned off or kept at a constant value when setting theratio of the resistance of the first resistor to the resistance of asecond resistor.
 30. The method of claim 25, wherein the first current,the another first current and the second current are turned off beforeproviding the current flow through the first resistor.